package com.junjun.ssm.dao;

import com.junjun.ssm.entity.NewsEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface INewByHqlDao extends CrudRepository<NewsEntity,String> {

    @Query("from NewsEntity n where n.newsId=?1 ")
    public NewsEntity queryAllById(String newsId);


    @Query("from NewsEntity  ")
    public List<NewsEntity> queryAll();

    @Query("delete from NewsEntity n where n.newsId=?1")
     void deleteByNewsId(String newsId);
}
